package com.freemyleft.left.left_app.mian.index.my.MyRanking.adapter;

import android.provider.ContactsContract;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.freemyleft.left.left_app.R;
import com.freemyleft.left.zapp.ui.recycler.DataConverter;
import com.freemyleft.left.zapp.ui.recycler.MultipleFields;
import com.freemyleft.left.zapp.ui.recycler.MultipleItemEntity;
import com.freemyleft.left.zapp.ui.recycler.MultipleRecyclerAdapter;
import com.freemyleft.left.zapp.ui.recycler.MultipleViewHolder;
import java.util.List;
public class MyRankingAdapter extends MultipleRecyclerAdapter {
    public final static int MY_RANKING_tYPE = 011;

    public MyRankingAdapter(List<MultipleItemEntity> data) {
        super(data);
        addItemType(MY_RANKING_tYPE, R.layout.item_ranking);
    }

    @Override
    protected void convert(MultipleViewHolder holder, MultipleItemEntity entity) {
        super.convert(holder, entity);
        String ranKing = entity.getField(MyRankingFiles.RANKING);
        String nikeName = entity.getField(MyRankingFiles.NIKENAME);
        String score = entity.getField(MyRankingFiles.SCORE);
        String photo=entity.getField(MyRankingFiles.PHOTO);
        holder.setText(R.id.tv_ranking, ranKing);
        holder.setText(R.id.tv_score, score);
        holder.setText(R.id.tv_name, nikeName);
        Glide.with(mContext).load(photo).into((ImageView) holder.getView(R.id.photo_imageCircle));
    }

    public enum MyRankingFiles {
        RANKING,
        PHOTO,
        NIKENAME,
        SCORE,

    }


}
